//
//  BRSlopingView.m
//  BOXY
//
//  Created by 甘卫国 on 2024/2/23.
//

#import "BRSlopingView.h"

@implementation BRSlopingView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setUI];
    }
    return self;
}

- (void)setTitle:(NSString *)title {
    _title = title;
    self.titleL.text = title;
}

#pragma mark - UI --
- (void)setUI {
    
//    self.clipsToBounds = YES;
    
    UIView *bgView = [[UIView alloc] init];
    
    bgView.backgroundColor = kUIColorMainTint;
    
    [self addSubview:bgView];
    
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(-6.4);
        make.right.offset(27.6);
        make.height.mas_equalTo(30);
        make.centerY.offset(-10.6);
    }];
    
    bgView.transform = CGAffineTransformMakeRotation(M_PI_4);
    
    self.titleL = [BRToolsView br_label:@"--" textColor:kColorTitle font:[UIFont fontS:13] textAlignment:NSTextAlignmentCenter];
    [bgView addSubview:self.titleL];
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.offset(0);
        make.left.offset(0);
        make.right.offset(0);
    }];
}

@end
